﻿<%@ Register TagPrefix="ucCommon" TagName="Common" Src="../Common/Inc/Common.ascx" %>
<%@ Register TagPrefix="ucComment" TagName="Comment" Src="../Common/Inc/Comment.ascx" %>
<%@ Register TagPrefix="ucTop" TagName="Top" Src="../Common/Inc/Top.ascx" %>
<%@ Register TagPrefix="ucMenu" TagName="Menu" Src="../Common/Inc/Menu.ascx" %>
<%@ Register TagPrefix="ucTabTitle" TagName="TabTitle" Src="../Common/Inc/TabTitle.ascx" %>
<%@ Register TagPrefix="ucCopyright" TagName="Copyright" Src="../Common/Inc/Copyright.ascx" %>
<%@ Register Assembly="ChartFX.WebForms" Namespace="ChartFX.WebForms" TagPrefix="chartfx7" %>
<%@ Register Assembly="ChartFX.WebForms.Adornments" Namespace="ChartFX.WebForms.Adornments" TagPrefix="chartfxadornments" %>
<%@ Register Assembly="ChartFX.WebForms" Namespace="ChartFX.WebForms.Galleries" TagPrefix="chartfx7galleries" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Crd2018r.aspx.cs" Inherits="Updms.Crd.Crd2018r" validateRequest="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>▒ UPDMS [Crd2018r] ▒▒▒▒▒▒▒▒▒▒</title>
<ucCommon:Common id="Common" runat="server"></ucCommon:Common>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" id="ScriptManager1" EnableScriptGlobalization="true"></asp:ScriptManager>

<table id="table_frame">
	<tr>
		<td id="top_area" colspan="2">
			<!-- Top 시작 -->
			<ucTop:Top id="Top" runat="server"></ucTop:Top>
			<!-- Top 끝 -->
		</td>
	</tr>
	<tr>
		<td id="menu_area">
			<!-- 메뉴 시작 -->
			<ucMenu:Menu id="Menu" runat="server"></ucMenu:Menu>
			<!-- 메뉴 끝 -->
		</td>
		<td id="contents_area">
			<!-- 제목 시작 -->
			<ucTabTitle:TabTitle id="TabTitle" TagPrefixs="Crd2018r" runat="server"></ucTabTitle:TabTitle>
			<!-- 제목 끝 -->
			<!-- AJAX 시작 -->
			<asp:UpdatePanel ID="UpdatePanel1" runat="server">
			<Triggers>
				<asp:PostBackTrigger ControlID="ibtn_excel"/>
			</Triggers>
			<ContentTemplate>
			<!-- 버튼 시작 -->
			<div class="button_area">
				<asp:linkbutton id="ibtn_excel" Text="엑셀" runat="server" CssClass="ibtn ibtn_excel" OnClick="ibtn_excel_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_map" Text="지도" runat="server" CssClass="ibtn ibtn_map" OnClientClick="showNaverMapMultiMarker();return false;"></asp:linkbutton>
				<asp:linkbutton id="ibtn_ftp" Text="아이폰" runat="server" CssClass="ibtn ibtn_phone" OnClientClick="return chkFtpTransfer();" OnClick="ibtn_ftp_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_search" Text="검색" runat="server" CssClass="ibtn ibtn_search" OnClientClick="return chkSearch()" OnClick="ibtn_search_Click"></asp:linkbutton>
			</div>
			<!-- 버튼 끝 -->			
			<!-- 검색 시작 -->
			<table class="table_search">
				<tr>
					<td class="lbl" width="11%"><asp:Literal id="ltr_search_base_year" Text="조회년도" runat="server" /></td>
					<td class="ctl" width="22%">
					<ul class="horizontal">
						<li style="width:70%;"><asp:dropdownlist id="ddl_search_base_year" runat="server" CssClass="ddl" AutoPostBack="True" OnSelectedIndexChanged="ddl_search_base_year_SelectedIndexChanged"></asp:dropdownlist></li>
						<li style="width:30%;"><asp:linkbutton id="ibtn_prev_year" ToolTip="전년" runat="server" OnClick="ibtn_prev_year_Click"><img src="../Common/Images/arrow_rect_left.gif" alt="전년" /></asp:linkbutton>
						<asp:linkbutton id="ibtn_this_year" ToolTip="당년" runat="server" OnClick="ibtn_this_year_Click"><img src="../Common/Images/control_rect_stop.gif" alt="당년" /></asp:linkbutton>
						<asp:linkbutton id="ibtn_next_year" ToolTip="차년" runat="server" OnClick="ibtn_next_year_Click"><img src="../Common/Images/arrow_rect_right.gif" alt="차년" /></asp:linkbutton></li>
					</ul>
					</td>
					<td class="lbl" width="11%"><asp:Literal id="ltr_search_div" Text="조회방법" runat="server" /></td>
					<td class="ctl" width="55%"><asp:RadioButtonList id="rbl_search_div" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="rbl_flow"></asp:RadioButtonList></td>
				</tr>
				<tr>
					<td class="lbl"><a href="javascript:void(0);" title="전체선택/해제" onclick="checkBoxCheckTable('cbl_search_card_cd');"><u><asp:Literal id="ltr_search_card_cd" Text="카드" runat="server" /></u></a></td>
					<td class="ctl" colspan="3"><asp:CheckBoxList id="cbl_search_card_cd" runat="server" RepeatDirection="Horizontal" CssClass="cbl_flow" AutoPostBack="true" onselectedindexchanged="cbl_search_card_cd_SelectedIndexChanged"></asp:CheckBoxList></td>
				</tr>				
			</table>
			<!-- 검색 끝 -->
			<!-- 디테일1 시작 -->
			<!-- 디테일1 끝 -->
			<!-- 리스트셋 시작 -->
			<table id="table_list_set" cellspacing="0" cellpadding="0" width="100%" border="0" runat="server">
				<tr>
					<td>
						<asp:GridView ID="GridView1" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound" DataKeyNames="View_Order,Account">
							<Columns>
								<asp:BoundField DataField="View_Order" HeaderText="View_Order(X)" Visible="False" />
								<asp:BoundField DataField="Account" HeaderText="Account(X)" Visible="False" />
								<asp:BoundField DataField="Account_Nm" HeaderText="계정" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Left" Width="20%" />
								</asp:BoundField>
								<asp:BoundField DataField="M01" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(1);'&gt;1월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M02" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(2);'&gt;2월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M03" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(3);'&gt;3월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M04" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(4);'&gt;4월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M05" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(5);'&gt;5월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M06" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(6);'&gt;6월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M07" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(7);'&gt;7월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M08" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(8);'&gt;8월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M09" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(9);'&gt;9월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M10" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(10);'&gt;10월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M11" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(11);'&gt;11월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M12" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(12);'&gt;12월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="Total_Amt" HeaderText="총액" DataFormatString="{0:#,###,##0}" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Right" Width="8%" />
								</asp:BoundField>
							</Columns>
							<EmptyDataTemplate>
								<div id="no_data"></div>
							</EmptyDataTemplate>
						</asp:GridView>
						<asp:GridView ID="GridView2" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView2_RowDataBound" DataKeyNames="Account,Card_Cd,View_Order">
							<Columns>
								<asp:BoundField DataField="View_Order" HeaderText="View_Order(X)" Visible="false" />
								<asp:BoundField DataField="Account_Nm" HeaderText="계정" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Left" Width="12%" />
								</asp:BoundField>
								<asp:BoundField DataField="Card_Nm" HeaderText="카드" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Left" Width="8%" />
								</asp:BoundField>
								<asp:BoundField DataField="M01" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(1);'&gt;1월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M02" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(2);'&gt;2월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M03" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(3);'&gt;3월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M04" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(4);'&gt;4월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M05" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(5);'&gt;5월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M06" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(6);'&gt;6월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M07" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(7);'&gt;7월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M08" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(8);'&gt;8월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M09" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(9);'&gt;9월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M10" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(10);'&gt;10월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M11" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(11);'&gt;11월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="M12" HeaderText="&lt;span class='b hand' onclick='viewMonthlyAmountByCardNAccount(12);'&gt;12월&lt;/span&gt;" HeaderStyle-Font-Underline="true" DataFormatString="{0:#,###,##0}" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Right" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="Total_Amt" HeaderText="총액" DataFormatString="{0:#,###,##0}" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Right" Width="8%" />
								</asp:BoundField>
							</Columns>
							<EmptyDataTemplate>
								<div id="no_data"></div>
							</EmptyDataTemplate>
						</asp:GridView>
					</td>
				</tr>
			</table>
			<!-- 리스트셋 끝 -->
			<!-- 모달영역(라인챠트) 시작 -->
			<asp:Panel ID="Panel1" style="display:none;" runat="server">
				<div class="div_box">
				<img id="img_close" src="../Common/Images/close.gif" class="hand" style="float:right;" onclick="hideChartByAccount();" alt="닫기" /><br />
				<chartfx7:chart id="chart_line" runat="server" height="200px" width="1000px" Palette="ChartFX6.ChartFX6" ImageSettings-Interactive="False">
					<AxisY Title-Text="금액 (원)">
					<Grids Major-Style="Dash" Interlaced="True"></Grids>
						<LabelsFormat CustomFormat="###,###,##0" />
					</AxisY>

					<AxisX Title-Text="">
					<Grids Major-Visible="False"></Grids>
					</AxisX>

					<AllSeries PointLabels-Visible="True"></AllSeries>

					<LegendBox ContentLayout="Near" Dock="Bottom"></LegendBox>

					<MainPane AxisY-Title-Text="금액 (원)"></MainPane>
					<SpecialObjects>
						<chartfxadornments:SimpleBorder AssemblyName="ChartFX.WebForms.Adornments" Color="Transparent"
							Type="None">
						</chartfxadornments:SimpleBorder>
						<chartfxadornments:GradientBackground AssemblyName="ChartFX.WebForms.Adornments"
							ColorFrom="Transparent" EffectArea="0">
						</chartfxadornments:GradientBackground>
					</SpecialObjects>
				<Series>
					<chartfx7:SeriesAttributes />
				</Series>
				</chartfx7:chart>
				</div>
			</asp:Panel>
			<!-- 모달영역(라인챠트) 끝 -->
			<!-- 설명 시작 -->
				<ucComment:Comment id="Comment" TagPrefixs="Crd2018r" runat="server"></ucComment:Comment>
			<!-- 설명 끝 -->
			<!-- 카피라이트 시작 -->
			<ucCopyright:Copyright id="Copyright" runat="server"></ucCopyright:Copyright>
			<!-- 카피라이트 끝 -->
			<!-- 히든값 시작 -->
			<div id="hdn_data">
				<asp:label id="lbl_pk" runat="server"></asp:label>
				<input type="hidden" id="h_row_idx" name="h_row_idx" value="" runat="server" />
				<input type="hidden" id="h_card_cd" name="h_card_cd" value="" runat="server" />
				<input type="hidden" id="h_card_nm" name="h_card_nm" value="" runat="server" />
				<asp:LinkButton ID="lbtn_set_chart" OnClick="lbtn_set_chart_Click" runat="server" />
			</div>
			<!-- 히든값 끝 -->
			<act:ModalPopupExtender ID="mpe_chart_line" runat="server"
				BehaviorID="mpe_chart_line_b"
				TargetControlID="lbtn_set_chart"
				PopupControlID="Panel1"
				CancelControlID="img_close"
				BackgroundCssClass="modalBackground" />
			</ContentTemplate>
			</asp:UpdatePanel>
			<!-- AJAX 끝 -->
		</td>
	</tr>
</table>

<asp:updateprogress AssociatedUpdatePanelID="UpdatePanel1" ID="updateProgress" runat="server">
	<progresstemplate>
		<div id="progressBackgroundFilter"></div>
		<div id="processMessage">
			<div id="processing"></div>
			<img src="../Common/Images/processing_img.gif" />
		</div>
	</progresstemplate>
</asp:updateprogress>

</form>

<script type="text/javascript" language="javascript" defer="defer">
	function chkSearch() {
		var lb_checked_item = false;

		if ($("cbl_search_card_cd") != null) {
			//체크박스 갯수
			var cb_cnt_item = getCheckBoxCntOnTable("cbl_search_card_cd");
			
			for (var i=0; i<cb_cnt_item; i++) {
				var cb = $("cbl_search_card_cd_"+i);
				if (cb.checked) {
					lb_checked_item = true;
				}
			}
			
			if (!lb_checked_item){
				msgBox.alert(getMsg(MSG_ERR_023)); //하나이상의 카드를 선택하세요
				return false;
			}
		} else {
			msgBox.alert(getMsg(MSG_ERR_025)); //해당년도에 사용된 카드가 없습니다.다른 년도를 선택하세요
			return false;
		}
		return true;
	}
	
	//상세조회 팝업
	function viewDetailList(card_cd, account, ym) {
		var url = "../Crd/Crd3011p.aspx?page_mode=P&kw1=" + card_cd + "&kw2=" + ym + "&kw3=" + account;
		popupPage(url, 800, 600, 'yes','no','yes');
	}

	//계정별 챠트
	function viewChartByAccount(idx) {
		$("h_row_idx").value = idx;
		__doPostBack('lbtn_set_chart', '');
	}

	//챠트 숨기기
	function hideChartByAccount() {
		var mpeBehavior = $find('mpe_chart_line_b');
		mpeBehavior.hide();
	}

	//월간사용분석표
	function viewMonthlyAmountByCardNAccount(mm) {
		if ($("cbl_search_card_cd") != null) {
			var lb_checked_item = false;
			//체크박스 갯수
			var cb_cnt_item = getCheckBoxCntOnTable("cbl_search_card_cd");
			
			for (var i=0; i<cb_cnt_item; i++) {
				var cb = $("cbl_search_card_cd_"+i);
				if (cb.checked) {
					lb_checked_item = true;
				}
			}
			
			if (!lb_checked_item){
				msgBox.alert(getMsg(MSG_ERR_023)); //하나이상의 카드를 선택하세요
				return false;
			}
		}

		var ls_base_ym = $F("ddl_search_base_year") + "-" + changeTwoDateType(mm);

		var url = "../Crd/Crd3013p.aspx?page_mode=P&kw1=" + $F("h_card_cd") + "&kw2=" + ls_base_ym + "&gs_card_nm=" + encodeURIComponent($F("h_card_nm"));

		popupPage(url, 960, 760, 'yes', 'yes', 'yes');
	}

	//FTP전송
	function chkFtpTransfer() {
		msgBox.confirm(getMsg(MSG_CFM_025), doFtpTransfer); //전송하시겠습니까?
		return false;
	}

	//지도팝업 - 멀티마커
	function showNaverMapMultiMarker() {
		if ($("cbl_search_card_cd") != null) {
			var lb_checked_item = false;
			//체크박스 갯수
			var cb_cnt_item = getCheckBoxCntOnTable("cbl_search_card_cd");

			for (var i = 0; i < cb_cnt_item; i++) {
				var cb = $("cbl_search_card_cd_" + i);
				if (cb.checked) {
					lb_checked_item = true;
				}
			}

			if (!lb_checked_item) {
				msgBox.alert(getMsg(MSG_ERR_023)); //하나이상의 카드를 선택하세요
				return false;
			}
		}
		var url = "../Common/Inc/NaverMapMultiMarker.aspx?mode=CRD&param=" + $F("h_card_cd") + "";
		popupPage(url, 600, 600, 'yes', 'yes', 'yes');
	}
</script>

</body>
</html>